package com.ag.admin.action;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.ServletContext;

import org.apache.struts2.interceptor.SessionAware;
import org.apache.struts2.util.ServletContextAware;
import org.springframework.stereotype.Controller;

import com.ag.admin.service.ILoginOutService;
import com.ag.common.AjaxNotify;
import com.ag.common.BaseAction;


public class CopyOfLoginOutAction extends BaseAction implements SessionAware,
		ServletContextAware {
	private static final long serialVersionUID = -8496731208820207926L;
	private Map<String, Object> session;
	private ServletContext context;
	@Resource(name = "LoginOutServiceImpl")
	private ILoginOutService lioService;
	/**
	 * 异步请求返回
	 */
	private String ajaxRst;
	/**
	 * 登录用户名
	 */
	private String UId;
	/**
	 * 登录密码
	 */
	private String UPassword;
	/**
	 * 登录验证码
	 */
	private String verifyCode;

	/**
	 * 登录验证
	 * 
	 * @return
	 */
	public String checkLogin() {
		try {
//			ajaxRst = lioService.checkLogin(UId.trim(), UPassword.trim(), verifyCode.trim(),
//					session, context);
			return "operate";
		} catch (Exception e) {
			e.printStackTrace();
			ajaxRst = AjaxNotify.EXCEPTION;
			return "operate";
		}
	}

	public void setUId(String id) {
		UId = id;
	}

	public void setUPassword(String password) {
		UPassword = password;
	}

	@Override
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}

	@Override
	public void setServletContext(ServletContext context) {
		this.context = context;
	}

	public void setVerifyCode(String verifyCode) {
		this.verifyCode = verifyCode;
	}

	public String getAjaxRst() {
		return ajaxRst;
	}

}
